﻿namespace PokerServer.Cache.Fight
{
    /// <summary>
    /// 回合管理类
    /// </summary>
    public class RoundModel
    {
        // 当前回合的最大出牌者
        public int BiggestUId { get; set; }

        // 当前的出牌者
        public int CurrentUid { get; set; }

        // 上一此的出牌长度
        public int LastLength { get; set; }

        // 上一此的出牌权值
        public int LastWight { get; set; }

        // 上一此的出牌的类型
        public int LastCardType { get; set; }


        public RoundModel()
        {
            BiggestUId = -1;
            CurrentUid = -1;
            LastLength = -1;
            LastWight = -1;
            LastCardType = -1;
        }

        /// <summary>
        /// 开始出牌
        /// </summary>
        /// <param name="userId"></param>
        public void Start(int userId)
        {
            CurrentUid = userId;
            BiggestUId = userId;
        }

        /// <summary>
        /// 改变出牌者
        /// </summary>
        /// <param name="biggestUId"></param>
        /// <param name="lastLength"></param>
        /// <param name="lastWight"></param>
        /// <param name="lastCardType"></param>
        public void Change(int biggestUId, int lastLength, int lastWight, int lastCardType)
        {
            BiggestUId = biggestUId;
            LastLength = lastLength;
            LastWight = lastWight;
            LastCardType = lastCardType;
        }

        /// <summary>
        /// 转换出牌
        /// </summary>
        /// <param name="userId"></param>
        public void Turn(int userId)
        {
            CurrentUid = userId;
        }
    }
}